/*
 * DatagramBuilder Library: serialize/deserialize data to/from datagram
 * Copyright (C) 2008 Rakov Ilya <RakovIlya@gmail.com>
 *
 * This library can be distributed under the terms of the GNU LGPLv2.
 * See the file COPYING.LIB.
 */


#ifndef DATAGRAM_ENDOFDATA_H_
#define DATAGRAM_ENDOFDATA_H_


/**
 * @file EndOfData.h
 *
 * @brief EndOfData header file
 *
 * @date Dec 15, 2008
 * @author Rakov Ilya
 */


#include "Builder.h"
#include "Parser.h"
#include "SerializeImpl.h"

#include <ostream>


/**
 * @brief This class indicates(checks) the end of the data stream.
 *
 * The EndOfData serialization does nothing and uses only for consistent.
 * The EndOfData deserialization checks a data stream for it`s end.
 * @note the deserialize_error will be thrown on the deserialization process
 * unless the data stream has reached the end.
 */
struct EndOfData
{

  /*
   * Defined only for comparing tuples
   */
  inline bool operator ==( EndOfData ) const;


  /*
   * Defined only for comparing tuples
   */
  inline bool operator !=( EndOfData ) const;

};


/**
 * @example EndOfData_example.cpp
 * This is an example of how to use the EndOfData class.
 *
 */


/** @relates EndOfData
 *
 * @brief Provides an ability to output the EndOfData into an output streams.
 */
template< class CharType, class CharTrait >
inline std::basic_ostream< CharType, CharTrait >&
operator <<( std::basic_ostream<CharType, CharTrait> &out, const EndOfData );


#include "impl/EndOfDataImpl.h"


#endif /* DATAGRAM_ENDOFDATA_H_ */
